package com.woniu.bh.backstage.controller;

import com.woniu.bh.backstage.client.BeautysalonServcieClient;
import com.woniu.bh.backstage.param.BeautysalonCheckResultParam;
import com.woniu.bh.backstage.param.ConditionedQueryParam;
import com.woniu.bh.common.core.dto.ResultDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @version: V1.0
 * @author: Xbao
 * @className: BeautysalonManager
 * @packageName: com.woniu.bh.backstage.controller
 * @description:
 * @data: 2020-10-19 16:38
 */
@RestController
@RequestMapping("bs")
@Slf4j
@Api(tags = "美容馆管理")
public class BeautysalonController {
    @Autowired
    private BeautysalonServcieClient beautysalonServcieClient;

    @PostMapping("/conditionedquery")
    @ApiOperation(value = "条件查询美容馆")
    public ResultDto bsconditionedquery(ConditionedQueryParam queryParam){
        return beautysalonServcieClient.conditionedQuery(queryParam);
    }

    @GetMapping("/querybs")
    @ApiOperation(value = "根据id查询美容馆详情")
    public ResultDto bsqueryBeautysalon(Integer bsId){
        return beautysalonServcieClient.queryBeautysalon(bsId);
    }

    @DeleteMapping("/del")
    @ApiOperation(value = "根据id删除美容馆")
    public ResultDto beautysalonDel(@RequestParam Integer beautysalonId){
        return beautysalonServcieClient.beautysalonDel(beautysalonId);
    }

    @PutMapping("/auditpass")
    @ApiOperation(value = "审核通过美容馆")
    public ResultDto auditPass(@RequestParam Integer beautysalonId){
        return beautysalonServcieClient.auditPass(beautysalonId);
    }

    @PutMapping("/auditrejected")
    @ApiOperation(value = "审核拒绝美容馆")
    public ResultDto auditRejected(@RequestBody BeautysalonCheckResultParam beautysalonCheckResultParam){
        return beautysalonServcieClient.auditRejected(beautysalonCheckResultParam);
    }
}
